package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.Contest;
import com.es.disped.dao.oj.model.ContestExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface ContestMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=ContestSqlProvider.class, method="countByExample")
    long countByExample(ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=ContestSqlProvider.class, method="deleteByExample")
    int deleteByExample(ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from contest",
        "where contest_id = #{contestId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer contestId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into contest (contest_id, title, ",
        "start_time, end_time, ",
        "defunct, private, langmask, ",
        "password, user_id, description)",
        "values (#{contestId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, ",
        "#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, ",
        "#{defunct,jdbcType=CHAR}, #{private,jdbcType=TINYINT}, #{langmask,jdbcType=INTEGER}, ",
        "#{password,jdbcType=CHAR}, #{userId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR})"
    })
    int insert(Contest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=ContestSqlProvider.class, method="insertSelective")
    int insertSelective(Contest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=ContestSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="private", property="private", jdbcType=JdbcType.TINYINT),
        @Result(column="langmask", property="langmask", jdbcType=JdbcType.INTEGER),
        @Result(column="password", property="password", jdbcType=JdbcType.CHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Contest> selectByExampleWithBLOBs(ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=ContestSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="private", property="private", jdbcType=JdbcType.TINYINT),
        @Result(column="langmask", property="langmask", jdbcType=JdbcType.INTEGER),
        @Result(column="password", property="password", jdbcType=JdbcType.CHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR)
    })
    List<Contest> selectByExample(ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "contest_id, title, start_time, end_time, defunct, private, langmask, password, ",
        "user_id, description",
        "from contest",
        "where contest_id = #{contestId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="private", property="private", jdbcType=JdbcType.TINYINT),
        @Result(column="langmask", property="langmask", jdbcType=JdbcType.INTEGER),
        @Result(column="password", property="password", jdbcType=JdbcType.CHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR),
        @Result(column="description", property="description", jdbcType=JdbcType.LONGVARCHAR)
    })
    Contest selectByPrimaryKey(Integer contestId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=ContestSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Contest record, @Param("example") ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=ContestSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Contest record, @Param("example") ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=ContestSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Contest record, @Param("example") ContestExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=ContestSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Contest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update contest",
        "set title = #{title,jdbcType=VARCHAR},",
          "start_time = #{startTime,jdbcType=TIMESTAMP},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "defunct = #{defunct,jdbcType=CHAR},",
          "private = #{private,jdbcType=TINYINT},",
          "langmask = #{langmask,jdbcType=INTEGER},",
          "password = #{password,jdbcType=CHAR},",
          "user_id = #{userId,jdbcType=VARCHAR},",
          "description = #{description,jdbcType=LONGVARCHAR}",
        "where contest_id = #{contestId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(Contest record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update contest",
        "set title = #{title,jdbcType=VARCHAR},",
          "start_time = #{startTime,jdbcType=TIMESTAMP},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "defunct = #{defunct,jdbcType=CHAR},",
          "private = #{private,jdbcType=TINYINT},",
          "langmask = #{langmask,jdbcType=INTEGER},",
          "password = #{password,jdbcType=CHAR},",
          "user_id = #{userId,jdbcType=VARCHAR}",
        "where contest_id = #{contestId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Contest record);
}